<div class="wrapper-md"  >
	<div class="panel panel-default">
		<div ng-controller="timeTaskCtrl">
			<div class="row">

				<div class="col-sm-12" >
					<form name="form-contact" ng-submit="processForm()" class="form-horizontal">
						<div class="panel-body">

							<div class="form-group">   
								<label  class="col-sm-2 control-label">所属频道：</label>
								<div class="col-sm-4">
									<input type="text" class="form-control" placeholder="节目名称" ng-model="contact.ChannelName" >
								</div>
							</div>



							<div class="line line-dashed b-b line-lg pull-in"></div>

							<div class="form-group">
				                <label class="col-sm-2 control-label">录制周期:</label>
					            <div  class="col-sm-3">
						            <select id="cyc" onchange="selectCycles()" >
						            <option value="0" >==请选择==</option>
								   	<option value="day">每日任务</option>
								   	<option value="week">每周任务</option>
								   	<option value="month">每月任务</option>
									</select>
								</div>
				       
				            <label class="col-sm-1 control-label">范围:</label>
					            <div  class=" btn-group" style="width:424.2px; height: auto;" id="divs" data-toggle="buttons">
								</div>
				            </div>

				        <div class="line line-dashed b-b line-lg pull-in"></div>
							<label class="col-sm-2 control-label">开始时间</label>
								<div class="col-sm-4">
									<input type="text"  ng-model="contact.BeginTime" id="BeginTime"   onFocus="WdatePicker({dateFmt:'HH:mm:ss'})" class="form-control" />
								</div>

								<label  class="col-sm-2 control-label">结束时间</label>
								<div class="col-sm-4">
									<input type="text"  ng-model="contact.EndTime" id="EndTime"   onFocus="WdatePicker({dateFmt:'HH:mm:ss'})" class="form-control" />
								</div>
							</div>


								<!--隐藏字段-->
								<input type="hidden"  ng-model="contact.Id"  >
								<input type="hidden" id="channelId" ng-model="channelId"  >
								<input type="hidden"  ng-model="contact.ChannelName"  >
								<input type="hidden"  ng-model="contact.BeginTime"  >
								<input type="hidden"  ng-model="contact.EndTime"  >
								<input type="hidden"  ng-model="contact.AdderId"  >
								<input type="hidden"  ng-model="contact.AdderName"  >
								<input type="hidden"  ng-model="contact.AddTime"  >
								<input type="hidden"  ng-model="contact.UpdaterId"  >
								<input type="hidden"  ng-model="contact.UpdaterName"  >
								<input type="hidden"  ng-model="contact.UpdateTime"  >
								<input type="hidden"  ng-model="contact.DelFlag" ng-init="contact.DelFlag='0'" >

								<!--隐藏字段-->

								<footer class="panel-footer text-right bg-light lter">
									<button type="submit" class="btn btn-success">确认</button>
									<button type="button" class="btn btn-warning" ng-click='Cancel()'>取消</button>
								</footer>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
<style type="text/css">
	.bgColor{
		background-color:#E0FFFF
	}
	
</style>
<!--angularjs-->
<script type="text/javascript">

app.controller('timeTaskCtrl', function ($scope, $state, $stateParams,$http,$window) {

   var channelId = $stateParams.channelId;
   var channelUrl = API_URL+"channel_info?query=delflag:0,Id:"+channelId;
   var Channel = MY_ASYNC_AJAX(channelUrl)[0];
   $("#channelName").val(Channel.ChannelName);
   $scope.contact = Channel;
  	//表单提交开始
	$scope.processForm= function (){

		var ss = document.getElementsByClassName('bgColor');

		for(var i=0;i<ss.length;i++){
			console.log(ss[i].value);
		}
		
		
		

	}

	//取消
	$scope.$window = $window;
	$scope.Cancel=function(){
	
	 $window.history.back(-1);
	}
	//取消结束
})


function selectCycles(){
	var cyc = $("#cyc").val();
	var result = getcycle(cyc);

	$("#divs").empty();
	$.each(result, function(i,op){
		
	$("#divs").append("<span class='btn btn-default' onclick='check(this)' value='"+op["value"]+"'>"+op["key"]+"</span>");


	});

}




</script>
<!--angularjs-->










